package com.jucai.pppeiyouclient.receiver;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.jucai.pppeiyouclient.utils.LogUtils;

import io.rong.push.notification.PushMessageReceiver;
import io.rong.push.notification.PushNotificationMessage;

/**
 * Created by UPC on 2017/5/8.
 */

public class RongPushMessageReceiver extends PushMessageReceiver {
    @Override
    public boolean onNotificationMessageArrived(Context context, PushNotificationMessage pushNotificationMessage) {
        LogUtils.e("RongPushMessageReceiver-onNotificationMessageArrived 接收推送监听");
        return false;
    }

    @Override
    public boolean onNotificationMessageClicked(Context context, PushNotificationMessage pushNotificationMessage) {
        LogUtils.e("RongPushMessageReceiver-onNotificationMessageClicked 接收推送监听");
        Intent intent = new Intent();
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        Uri.Builder builder = Uri.parse("rong://" + context.getPackageName()).buildUpon();
        builder.appendPath("conversationlist");
        Uri uri = builder.build();
        intent.setData(uri);
        context.startActivity(intent);
        return false;
    }
}
